#include <string.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>

#include "archive_drivers.h"

extern ArchiveRomDriver archive_zip_driver;

static ArchiveRomDriver *archiver_rom_drivers[] = {
    &archive_zip_driver,
};
#define N_ARCHIVER_ROM_DRIVERS (sizeof(archiver_rom_drivers) / sizeof(ArchiveRomDriver *))

ArchiveRomDriver *Archive_GetDriver(const char *ext)
{
    if (!ext)
        return NULL;

    int index;
    for (index = 0; index < N_ARCHIVER_ROM_DRIVERS; index++)
    {
        if (strcasecmp(ext, archiver_rom_drivers[index]->extension) == 0)
            return archiver_rom_drivers[index];
    }

    return NULL;
}
